<!DOCTYPE html>
<html>
<head>
	<title>symbol</title>
</head>
<body>
<script type="text/javascript">
	

/* 
	1. symbol不是字符串类型

	2. symbol类型的变量唯一存在

	3. symbol不能被for遍历
	
*/
let name = Symbol('name');
let namea = Symbol('name');
console.log(name);
console.log(name.toString() === name);  // fasle
console.log(name == namea);				// false

let obj = {
	[name]: 'cuihao',
	age: 12
}
for (let key in obj) {
	console.log(key+': '+obj[key]);
}


let res = Object.getOwnPropertyNames(obj);		// 不能获取symbol值
let res = Object.getOwnPropertySymbols(obj);
console.log(res)

</script>
</body>
</html>